package cn.cdeden.knowledge.service.impl;

import cn.cdeden.common.core.utils.MapstructUtils;
import cn.cdeden.knowledge.api.domain.RemoteSysMessageService;
import cn.cdeden.knowledge.api.domain.vo.RemoteSysMessageVo;
import cn.cdeden.knowledge.domain.SysMessage;
import cn.cdeden.knowledge.mapper.SysMessageMapper;
import cn.cdeden.resource.api.RemoteMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

@RequiredArgsConstructor
@Service
@DubboService
public class RemoteSysMessageServiceImpl implements RemoteSysMessageService {

//    private final RedisUtils redisUtils;
    private final SysMessageMapper sysMessageMapper;

    @Override
    public List<RemoteSysMessageVo> getUserPushMessage(Long userId) {
        List<SysMessage> userPushMessage = sysMessageMapper.getUserPushMessage(userId);
        return MapstructUtils.convert(userPushMessage, RemoteSysMessageVo.class);
    }
}
